package com.example.bbook.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.bbook.util.HashMapTool;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.HashMap;

@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("s_role")
public class RoleEntity extends BaseEntity {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String title;
    private String name;
    private String rules;
    private Integer isDel;
    private String remark;

    public RoleEntity() {
        setColumns(new ArrayList<>());
        push("id", "number", "ID", new int[]{1, 1, 1, 0})
                .push("title", "string", "角色标题", new int[]{1, 1, 1, 1})
                .push("name", "string", "角色名", new int[]{1, 1, 1, 1})
                .push("rules", "string", "权限列表", new int[]{1, 1, 1, 0})
                .push("isDel", "number", "角色状态", new int[]{1, 1, 1, 1})
                .push("remark", "text", "角色简介", new int[]{1, 1, 1, 0});

    }

    public ArrayList<HashMap<String, Object>> thisColumns() {
        return getColumns();
    }
}
